// widgets/refresh_error_alert.dart
import 'package:flutter/material.dart';

enum LoadErrorType {
  noData,
  noNetwork,
}

class RefreshErrorAlert extends StatelessWidget {
  final LoadErrorType type;
  final String tip;

  const RefreshErrorAlert({
    Key? key,
    required this.type,
    required this.tip,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(20),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Icon(
            type == LoadErrorType.noData ? Icons.inbox_outlined : Icons.wifi_off,
            size: 60,
            color: Colors.grey.shade400,
          ),
          const SizedBox(height: 16),
          Text(
            tip,
            style: TextStyle(
              fontSize: 14,
              color: Colors.grey.shade600,
            ),
          ),
        ],
      ),
    );
  }
}